﻿<div class="row clearfix" ng-controller="app.views.users.index as vm">
    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
        <div class="card main-content">
            <div class="header">
                <h2>
                    @L("Users")
                </h2>
                <ul class="header-dropdown m-r--5">
                    <i class="fa fa-spin fa-spinner" ng-if="vm.isTableLoading"></i>
                    <li class="dropdown">
                        <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                            <i class="material-icons">more_vert</i>
                        </a>
                        <ul class="dropdown-menu pull-right">
                            <li><a href="javascript:void(0);" class="waves-effect waves-block()" ng-click="vm.refresh();"><i class="material-icons">refresh</i> @L("Refresh")</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="body table-responsive">

                <!-- ******************************************************** -->
                <table class="table table-hover table-striped">
                    <thead>
                        <tr>
                            <th>@L("UserName")</th>
                            <th>@L("FullName")</th>
                            <th>@L("EmailAddress")</th>
                            <th>
                                <div style="text-align:center">@L("IsActive")</div>
                            </th>
                            <th>@L("Actions")</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="user in vm.users">
                            <td>{{user.userName}}</td>
                            <td>{{user.fullName}}</td>
                            <td>{{user.emailAddress}}</td>
                            <td align="center">
                                <i class="material-icons" ng-if="user.isActive" style="color:green;">check_box</i>
                                <i class="material-icons" ng-if="!user.isActive" style="color:red;">indeterminate_check_box</i>
                            </td>
                            <td class="dropdown">
                                <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                                    <i class="material-icons">menu</i>
                                </a>
                                <ul class="dropdown-menu pull-right">
                                    <li><a href="javascript:void(0);" class="waves-effect waves-block" ng-click="vm.openUserEditModal(user)"><i class="material-icons">create</i>@L("Edit")</a></li>
                                    <li><a href="javascript:void(0);" class="waves-effect waves-block" ng-click="vm.delete(user)"><i class="material-icons">delete_sweep</i>@L("Delete")</a></li>
                                </ul>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <!-- ******************************************************** -->

                <button type="button" data-toggle="modal" class="btn btn-primary btn-circle waves-effect waves-circle waves-float pull-right" ng-click="vm.openUserCreationModal()">
                    <i class="material-icons">add</i>
                </button>
            </div>
        </div>
    </div>
</div>